
package englishauction;

import jade.content.onto.BasicOntology;
import jade.content.onto.Ontology;
import jade.content.schema.AgentActionSchema;
import jade.content.schema.ObjectSchema;
import jade.content.schema.PrimitiveSchema;


public class AuctionOntology extends Ontology implements AuctionVocabulary {
	   
	public static final String ONTOLOGY_NAME = "Auction-Ont";
	private static Ontology instance = new AuctionOntology();

	public static Ontology getInstance() 
	{ 
		return instance; 
	}	
   
   private AuctionOntology() {
   		
   	super(ONTOLOGY_NAME, BasicOntology.getInstance());
   		try {
   			AgentActionSchema as = new AgentActionSchema(NEW_ITEM);
   			add(as, NewItem.class);
   			as.add(NEW_ITEM_PRICE, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
   			as.add(NEW_ITEM_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
   			as.add(NEW_ITEM_AUTHOR, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.OPTIONAL);
   			as.add(NEW_ITEM_FLAG, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.OPTIONAL);
   			
   			
   			as = new AgentActionSchema(NEW_PRICE);
   			add(as, NewPrice.class);
   			as.add(NEW_PRICE_ITEM_PRICE, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
   			as.add(NEW_PRICE_ITEM_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
   			
   			
   			
   			as = new AgentActionSchema(I_BUY_IT);
   			add(as, Buy.class);
   			as.add(I_BUY_IT_ITEM_PRICE, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
   			as.add(I_BUY_IT_ITEM_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
   			
   			
   			as = new AgentActionSchema(YOU_GET_IT);
   			add(as, Purchase.class);
   			as.add(YOU_GET_IT_ITEM_PRICE, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
   			as.add(YOU_GET_IT_ITEM_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
   			
   			
   			as = new AgentActionSchema(SOLD);
   			add(as, Sell.class);
   			
   			as = new AgentActionSchema(YOU_GET_IT);
   			add(as, Purchase.class);
   			as.add(YOU_GET_IT_ITEM_PRICE, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
   			as.add(YOU_GET_IT_ITEM_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
   			
   			
   			} catch (Exception e){
   				e.printStackTrace();
   			}
   }
} 